package com.gzu.shop.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;

@Configuration
@Slf4j
public class SwaggerConfig {
    //    http://localhost:8085/swagger-ui/index.html
    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI()
                .info(new Info().title("Shop")
                        .contact(new Contact())
                        .description("我的API文档")
                        .version("v1")
//                        .license(new License()
//                                .name("Apache 2.0")
//                                .url("http://springdoc.org")
//                        )
                )
                .externalDocs(new ExternalDocumentation()
//                        .description("外部文档")
//                        .url("https://springshop.wiki.github.org/docs")
                )
                ;
    }
}


